using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WeddingDBTableAdapters;

public partial class Guestbook : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

	protected void lnkShowInput_Click(object sender, EventArgs e)
	{
		pnlLink.Visible = false;
		pnlInput.Visible = true;
		pnlMsgs.Visible = false;
		SetFocus(txtName);
	}

	protected void btnSave_Click(object sender, EventArgs e)
	{
		MessagesTableAdapter msgAdapter = new MessagesTableAdapter();
		msgAdapter.Insert(txtName.Text, txtMsg.Text, DateTime.Now);
		lblMsg.Text = "Your message was added successfully.<br />&nbsp;";
		pnlInput.Visible = false;
		pnlMsgs.Visible = true;
		lblMsg.Visible = true;
		DataBind();
	}

	protected void btnCancel_Click(object sender, EventArgs e)
	{
		pnlLink.Visible = true;
		pnlInput.Visible = false;
		pnlMsgs.Visible = true;
	}
}
